<?php

require_once 'config/config.php';
$connection = mysql_connect(DB_HOST . ":" . DB_PORT, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection); 


function getPages($query){
    global $connection;
    $pages = array();
    $results = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($results)) {
        $pages[] = $row;
    }
    return $pages;    
}

function getCompanies($query){
    global $connection;
    $companies = array();
    $results = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($results)) {
        $companies[] = $row;
    }
    return $companies;
}
function getApps($query) {
    
    global $connection;
    $apps = array();
    $results = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($results)) {
        $apps[] = $row;
    }
    return $apps;
}
